import { Pagination } from '@/types/global';
import { ref } from 'vue';

export default function useTable<T>() {
  const pager = ref<Pagination>({
    pageIndex: 1,
    pageSize: 20,
  });

  const total = ref(0);

  const loading = ref(false);

  const list = ref<T[]>([]);

  return {
    pager,
    total,
    loading,
    list,
  };
}
